package com.ibm.cloud.banking.facade.account;


import com.ibm.cloud.banking.facade.account.dto.*;
import com.ibm.cloud.banking.facade.customer.dto.CustAcctRelDTO;

import java.math.BigDecimal;
import java.util.List;

public interface IAccountFacade {
	public final static String DOMAIN="account";
	String ATOMIC_ENDPOINT_PATH = "/atomic/";
 
	static final String PATH=ATOMIC_ENDPOINT_PATH+DOMAIN+"/";
	

	String ACCT_TRANSFER_OUT=PATH+"acct_transfer_out";
	String acctTransferOut(AccountBalanceUpdateDTO paramsDto);

	String ACCT_TRANSFER_IN=PATH+"acct_transfer_in";
	String acctTransferIn(AccountBalanceUpdateDTO paramsDto) ; //throws Exception;
	

//	static final String QUERY_ACCOUNT_BY_CUSTNO=PATH+"query_by_custno";
//	List<AccountDTO> findByCustNo(@MappingValue(CustomerNo.class) String custNo);
//
//	static final String QUERY_ACCOUNT_BY_ACCOUNTNO=PATH+"query";
//	AccountDTO findByAccountNo(@MappingValue(AccountNo.class) String accountNo);
//
//	static final String QUERY_SMALL_ACCOUNT=PATH+"small";
//	List<AccountDTO> querySmallAccount(int balance);
//
//	static final String CHECK_ACCOUNT_STATUS=PATH+"check";
//	int checkAccountStatus(@MappingValue(AccountNo.class) String accountNo);

	/**
	 * 检查同客户同一产品有效账户数
	 * @param custAcctRels 同客户同产品账户列表
	 * @param sameCustAcctCnt 同客户同产品最大允许开户数
	 * @return 有效账户数
	 */
	int getSingleProductEffectiveAcctCnt(List<CustAcctRelDTO> custAcctRels, int sameCustAcctCnt);

	int getSingleProductEffectiveAcctCnt(CustAcctRelDTO custAcctRelDTO);


	static final String UPDATE_ACCOUNT_BALANCE=PATH+"update_balance";
	String updateAccountBalance(AccountBalanceUpdateDTO paramsDto);

	static final String SAVING_ACCOUNT=PATH+"save";
	AccountInfoDTO savingCustAcct(AccountInfoDTO accountInfoDTO);
    AccountBalanceQueryRespDTO getAccountBalance(String accountNo);

	/**
	 * 账户支取状态检查
	 * @param accountNo 账号
	 * @param withdrawalAmount 支取金额
	 * @return 账户信息
	 */
	AccountInfoDTO checkAcctWithdrawalStatus(String accountNo,BigDecimal withdrawalAmount);

	AccountInfoDTO checkAcctWithdrawalStatus(AccountInfoDTO accountDTO);

	/**
	 * 账户存入状态检查
	 * @param accountNo 账号
	 * @param name 用户名
	 * @return 账户信息
	 */
	AccountInfoDTO checkAcctDepositStatus(String accountNo,String name);

	AccountInfoDTO checkAcctDepositStatus(AccountInfoDTO accountDTO);

	/**
	 * 校验转账账户的通存通兑标志
	 * @param accountNoOut
	 * @param branchId
	 * @return
	 */
	void checkAcctOutDpDw(String accountNoOut, String branchId);
	
	/**
	 * 校验转账账户的通存通兑标志
	 * @param accountNoIn
	 * @param branchId
	 * @return
	 */
	void checkAcctInDpDw(String accountNoIn, String branchId);
	void checkAcctInDpDw(AccountInfoDTO accountInfoDTO);
	
	/**
	 * 获取指定交易日期账户开户和销户列表
	 * @param transDate 交易日期 yyyyMMdd
	 * @return 开户和销户列表
	 */
	static final String GET_OPEN_AND_CLOSE_ACCTS=PATH+"getOpenAndCloseAccts";
	List<AcctOpenAndCloseDetailDTO> getOpenAndCloseAccts(String transDate);

	String UPDATE_ACCOUNT_BALANCE_REFUND=PATH+"update_balance_refund";
	String updateAccountBalanceForRefund(AccountBalanceUpdateDTO paramsDto, Boolean isRefund);

	void checkAcctOutDpDw(AccountInfoDTO accountInfoDTO);

	void acctTransferInRefund(AccountBalanceUpdateDTO accountBalanceUpdateDTO);

	void acctTransferOutRefund(AccountBalanceUpdateDTO accountBalanceUpdateDTO);

    Integer deleteAccount(String accountNo);

	AccountLimitAmtTxSumDTO checkAcctDayWithdrawLimit(AccountLimitAmtTxSumDTO accountLimitAmtTxSumDTO);

	int updateAcctDayWithdrawLimit(AccountLimitAmtTxSumDTO acctLimitAmitDto);

}
